//
//  ViewForDestinationHeader.m
//  ProjectA
//
//  Created by dllo on 16/3/3.
//  Copyright © 2016年 刘旺辉. All rights reserved.
//

#import "ViewForDestinationHeader.h"
#import "AppMacro.h"
@implementation ViewForDestinationHeader


- (void)dealloc {
    
    [_labelForName release];
    [_labelForCount release];
    [_imageView release];
    [super dealloc];

}
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView = [[UIImageView alloc] init];
        [self addSubview:self.imageView];
        [_imageView release];
        
        self.labelForName = [[UILabel alloc] init];
        [self.imageView addSubview:self.labelForName];
        [_labelForName release];
        
        self.labelForCount = [[UILabel alloc] init];
        [self.imageView addSubview:self.labelForCount];
        [_labelForCount release];
    }
    return self;
}

- (UICollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    
    self.imageView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - 10);
    self.labelForName.frame = CGRectMake(25, self.imageView.bounds.size.height - 50 - 30, self.imageView.bounds.size.width - 100, 50);
    self.labelForName.font = [UIFont systemFontOfSize:25];
    
    
    self.labelForCount.frame = CGRectMake(25, self.imageView.bounds.size.height - 35, self.imageView.bounds.size.width - 100, 25);
    self.labelForCount.font = [UIFont systemFontOfSize:13];
    
    [UIView setColorWithLabelText:self.labelForName nightColor:L_COLOR_WHITE dayColor:L_COLOR_WHITE];
    [UIView setColorWithLabelText:self.labelForCount nightColor:L_COLOR_WHITE dayColor:L_COLOR_WHITE];
    return layoutAttributes;
}
@end
